3.1.3 \(\int \frac {\cos ^2(x)}{a+a \csc (x)} \, dx\) [3]

Optimal. Leaf size=27 \[ -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a} \]

[Out]

-1/2*x/a-cos(x)/a+1/2*cos(x)*sin(x)/a

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3957, 2918, 2718, 2715, 8} \begin {gather*} -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\sin (x) \cos (x)}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]^2/(a + a*Csc[x]),x]

[Out]

-1/2*x/a - Cos[x]/a + (Cos[x]*Sin[x])/(2*a)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2918

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3957

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Co
s[e + f*x])^p*((b + a*Sin[e + f*x])^m/Sin[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \frac {\cos ^2(x)}{a+a \csc (x)} \, dx &=\int \frac {\cos ^2(x) \sin (x)}{a+a \sin (x)} \, dx\\ &=\frac {\int \sin (x) \, dx}{a}-\frac {\int \sin ^2(x) \, dx}{a}\\ &=-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a}-\frac {\int 1 \, dx}{2 a}\\ &=-\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 27, normalized size = 1.00 \begin {gather*} -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\sin (2 x)}{4 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^2/(a + a*Csc[x]),x]

[Out]

-1/2*x/a - Cos[x]/a + Sin[2*x]/(4*a)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(48\) vs. \(2(23)=46\).
time = 0.07, size = 49, normalized size = 1.81

method result size
risch \(-\frac {x}{2 a}-\frac {\cos \left (x \right )}{a}+\frac {\sin \left (2 x \right )}{4 a}\) \(24\)
default \(\frac {\frac {4 \left (-\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{4}-\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}+\frac {\tan \left (\frac {x}{2}\right )}{4}-\frac {1}{2}\right )}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) \(49\)
norman \(\frac {-\frac {2}{a}-\frac {\tan \left (\frac {x}{2}\right )}{a}-\frac {\tan ^{4}\left (\frac {x}{2}\right )}{a}-\frac {3 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}-\frac {\tan ^{2}\left (\frac {x}{2}\right )}{a}-\frac {x}{2 a}-\frac {x \tan \left (\frac {x}{2}\right )}{2 a}-\frac {x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{a}-\frac {x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}-\frac {x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{2 a}-\frac {x \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{2 a}}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2} \left (\tan \left (\frac {x}{2}\right )+1\right )}\) \(132\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a+a*csc(x)),x,method=_RETURNVERBOSE)

[Out]

4/a*((-1/4*tan(1/2*x)^3-1/2*tan(1/2*x)^2+1/4*tan(1/2*x)-1/2)/(tan(1/2*x)^2+1)^2-1/4*arctan(tan(1/2*x)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 81 vs. \(2 (23) = 46\).
time = 0.47, size = 81, normalized size = 3.00 \begin {gather*} \frac {\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {2 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 2}{a + \frac {2 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}} - \frac {\arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="maxima")

[Out]

(sin(x)/(cos(x) + 1) - 2*sin(x)^2/(cos(x) + 1)^2 - sin(x)^3/(cos(x) + 1)^3 - 2)/(a + 2*a*sin(x)^2/(cos(x) + 1)
^2 + a*sin(x)^4/(cos(x) + 1)^4) - arctan(sin(x)/(cos(x) + 1))/a

________________________________________________________________________________________

Fricas [A]
time = 3.07, size = 18, normalized size = 0.67 \begin {gather*} \frac {\cos \left (x\right ) \sin \left (x\right ) - x - 2 \, \cos \left (x\right )}{2 \, a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="fricas")

[Out]

1/2*(cos(x)*sin(x) - x - 2*cos(x))/a

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cos ^{2}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**2/(a+a*csc(x)),x)

[Out]

Integral(cos(x)**2/(csc(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 44, normalized size = 1.63 \begin {gather*} -\frac {x}{2 \, a} - \frac {\tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} - \tan \left (\frac {1}{2} \, x\right ) + 2}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{2} a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^2/(a+a*csc(x)),x, algorithm="giac")

[Out]

-1/2*x/a - (tan(1/2*x)^3 + 2*tan(1/2*x)^2 - tan(1/2*x) + 2)/((tan(1/2*x)^2 + 1)^2*a)

________________________________________________________________________________________

Mupad [B]
time = 0.24, size = 17, normalized size = 0.63 \begin {gather*} -\frac {\frac {x}{2}-\frac {\sin \left (2\,x\right )}{4}+\cos \left (x\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^2/(a + a/sin(x)),x)

[Out]

-(x/2 - sin(2*x)/4 + cos(x))/a

________________________________________________________________________________________